package com.bank.model.vo.transfer;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author Cejay1314
 * @version 1.0
 * @create 2023/3/29 15:53
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TransferVo {
    @JsonSerialize(using= ToStringSerializer.class)
    Long id;
    @JsonSerialize(using=ToStringSerializer.class)
    Long fromId;
    @JsonSerialize(using=ToStringSerializer.class)
    Long toId;
    Boolean ifSelf;
    String status;
    String type;
    Double money;
    Double serviceCharge;
    String remarks;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")  // 返回给前端的时候进行格式化
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 前端转递过来的时候进行格式化
    Date createdTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")  // 返回给前端的时候进行格式化
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 前端转递过来的时候进行格式化
    Date finishedTime;
}
